#例10.9异常处理之自定义异常
class MyFirstError(Exception):
    def __init__(self,value):
        self.value= value
        def __str__(self):
            return repr(self.value)
try:
    raise MyFirstError(2*2)
except MyFirstError as mfe:
    print("发生了用户自定义异常，异常值为：",mfe.value)
